Views [dbo].[vSoaInvoiceLineAR]
Properties
PropertyValue
ANSI Nulls OnYes
Quoted Identifier OnYes
Created2:16:49 PM Wednesday, February 22, 2012
Last Modified2:16:49 PM Wednesday, February 22, 2012
Columns
Name
InvoiceLineId
InvoiceId
LineNumber
ItemId
ShipToPartyId
Quantity
UnitPrice
ExtendedAmount
PaymentAdjustmentAmount
PendingPaymentAdjustmentAmount
Balance
BILL_DATE
SQL Script

CREATE VIEW [dbo].[vSoaInvoiceLineAR]
AS
SELECT il.InvoiceLineId,
       il.InvoiceId,
       il.LineNumber,
       il.ItemId,
       il.ShipToPartyId,
       il.Quantity,
       il.UnitPrice,
       il.ExtendedAmount,
       il.PaymentAdjustmentAmount,
       ISNULL(pp.[Amount],0) AS PendingPaymentAdjustmentAmount,
       (il.ExtendedAmount - il.PaymentAdjustmentAmount - ISNULL(pp.[Amount],0)) AS Balance,
       CAST(null AS datetime) BILL_DATE
  FROM [dbo].[vSoaInvoiceLineARBase] il
  LEFT JOIN  [dbo].[vSoaPendingARPaymentAdjustment] pp ON il.[REFERENCE_NUM] = pp.[INVOICE_REFERENCE_NUM] AND il.[LineNumber] = pp.[INVOICE_LINE_NUM]


GO
Uses
Used By